<template>
  <div>
    <van-field v-model="from.name" label="资源名称" placeholder="请输入资源名称" />
    <van-field v-model="from.url" label="资源" placeholder="请输入资源" />
    <van-button @click='add'>添加</van-button>
  </div>
</template>

<script>
export default {
name: "add_resources",
  data(){
    return{
      from:{'url':''},
    }
  },
  methods:{
    add(){
      this.$axios.post('/table/resources',this.from).then(res=>{
        if(res.data.code==200){
          this.$toast.success('添加成功')
        }
      })
    }
  },
  mounted() {
    this.from.url = window.location.href
  }
}
</script>

<style scoped>

</style>
